package com.simtop.dao;

import com.simtop.pojo.User;
import com.simtop.vo.UserVo;
import com.simtop.vo.UserVos;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.python.antlr.op.In;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserDao {

    int checkLoginName(String loginName);

    int checkEmail(String email);

    int insert(User user);

    User checkLoginNameOrEmail(@Param("loginName") String loginName);

    int updatePasswordByEmail(User user);

    List<User> selectAll(User user);

    int insertBackUser(User user);

    int deleteByUserId(Integer id);

    int updateBackendUser(User user);

    List<User> selectByParams(User user);

    int selectUserCounts();

    User findById(Integer id);

    User findByLoginName(String loginName);

    int inserIlabUser(User user);

    /**
     * 统计各个省份对应的人数
     * @return
     */
    public List<Map<String,Integer>> getProvinceCount();

    /**
     * 统计各个角色对应的人数
     * @return
     */
    public List<Map<String,Integer>> getRoleCount();

    /**
     * 修改用户名
     * @param loginName
     * @param userName
     * @return
     */
    boolean updateUserName(@Param("loginName") String loginName,@Param("userName") String userName);

    List<User> findAlls();

    String findImage(@Param("id") Integer id);

    List<UserVo> finduser(@Param("loginName")String loginName);

    List<UserVos> finduser2();

    String finGroupOne(@Param("groupOne") Integer groupOne);

    String finGroupOne2(@Param("groupTwo") Integer groupTwo );

    List<UserVos> findAllUserList(@Param("sqsyidlist") ArrayList<Integer> sqsyidlist);

    void deleteByUserIdList(@Param("sqsyidlist") ArrayList<Integer> sqsyidlist);

    Integer setcountid(@Param("id") Integer id);

    void savecountid(@Param("last") Integer last,@Param("id") Integer id);

    void savetime(@Param("date") Date date,@Param("id") Integer id);

    void saveip(@Param("hostAddress") String hostAddress,@Param("id") Integer id);
}
